package branice.spring.cloud.controller;

import branice.spring.cloud.api.API2;
import branice.spring.cloud.api.Api3ImplService;
import branice.spring.cloud.api.ReturnInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WsClientController {


//    @Autowired
//    API2 api2Client;

    /*@GetMapping("/wsClient")
    public Object test(){
        ReturnInfo info = api2Client.requestToken("aaa", "222");
        System.out.println(info.getMessage());
        return info;
    }*/

//    @Bean
    public  Api3ImplService api3ImplService(){
        return new Api3ImplService();
    }


//    @Autowired
    Api3ImplService api3ImplService;

    @GetMapping("/wsClient2")
    public Object test2(){
        ReturnInfo info = new Api3ImplService().getAPI3Port().requestToken1("aaa", "222");
        System.out.println(info.getMessage());
        return info;
    }


}
